<!-- $Id: goods_info.htm 17126 2010-04-23 10:30:26Z liuhui $ -->
{include file="pageheader.htm"}
{insert_scripts files="../js/utils.js,selectzone.js,colorselector.js"}
<!-- start goods form -->
<div class="tab-div">
<form action="service.php?act=essay" method="POST" name="form1">
	<table width="90%" align="center">
		<tr>
            <td class="label">服务简介：</td>
            <td><textarea rows="5" cols="50" name="brief">{$service.brief}</textarea></td>
          </tr>
		<tr>
            <td class="label">详细描述：</td>
            <td><textarea rows="5" cols="50" name="service_desc">{$service.service_desc}</textarea></td>
          </tr>
		<tr>
            <td class="label">关键字：</td>
            <td><input type="text" name="keywords" value="{$service.keywords}" size="50"></td>
          </tr>
          <tr>
          <td class="label">收费标准：</td>
          	<td>
          		<table id="price-table" align="left">
          		{if $service.price}
          			{foreach from=$service.price item=price key=key name=loop}
          			<tr>
          				<td>
          				{if $smarty.foreach.loop.first}
          					<a href="javascript:;" onclick="addImg(this)">[+]</a>
          				{else}
          					<a href="javascript:;" onclick="removeImg(this)">[-]</a>
          				{/if}
          				<input type="text" name="minletter[]" value="{$service.minletter.$key}" size="5">~
          				<input type="text" name="maxletter[]" value="{$service.maxletter.$key}" size="5">字
          				<input type="text" name="price[]" value="{$price}" size="6">元</td>
          			</tr>
          			{/foreach}
          		{else}
          			<tr>
          				<td>
          				<a href="javascript:;" onclick="addImg(this)">[+]</a>
          				<input type="text" name="minletter[]" value="" size="5">~
          				<input type="text" name="maxletter[]" value="" size="5">字
          				<input type="text" name="price[]" value="" size="6">元</td>
          			</tr>
          		{/if}
          		</table>
          	</td>
          </tr>
		<tr>
            <td class="label">最大上传文件：</td>
            <td><input type="text" name="maxsize" value="{$service.maxsize}" size="5">M</td>
          </tr>
		<tr>
            <td class="label">加急费用：</td>
            <td><input type="text" name="urgency" value="{$service.urgency}" size="10"></td>
          </tr>
        <tr>
        <tr>
        	<td colspan="2" align="center">
        		<input type="submit" name="sub" value="保存" class="button"> 
        		<input type="reset"  name="res" value="重新填写" class="button">
        		<input type="hidden"  name="id" value="{$service.id}">
        		<input type="hidden"  name="op" value="save">
        	</td>
        </tr>
	</table>
	</form>
</div>
<script>
 /**
   * 鏂板?涓€涓?浘鐗
   */
  function addImg(obj)
  {
      var src  = obj.parentNode.parentNode;
      var idx  = rowindex(src);
      var tbl  = document.getElementById('price-table');
      var row  = tbl.insertRow(idx + 1);
      var cell = row.insertCell(-1);
      cell.innerHTML = src.cells[0].innerHTML.replace(/(.*)(addImg)(.*)(\[)(\+)/i, "$1removeImg$3$4-");
  }

  /**
   * 鍒犻櫎鍥剧墖涓婁紶
   */
  function removeImg(obj)
  {
      var row = rowindex(obj.parentNode.parentNode);
      var tbl = document.getElementById('price-table');

      tbl.deleteRow(row);
  }
</script>
{include file="pagefooter.htm"}
